﻿#include "homewindow.h"
#include <QApplication>
#include "easylogging++.h"

INITIALIZE_EASYLOGGINGPP    // 初始化宏，有且只能使用一次
#define LOG_PATH "E:\Qtworkspace\code\0voice_player-master\build-0voice_player-Desktop_Qt_5_14_2_MinGW_64_bit-Debug\log.ini"
#undef main
int main(int argc, char *argv[])
{

    el::Loggers::reconfigureAllLoggers(el::ConfigurationType::Format, "%datetime %level %func(L%line) %msg");

    el::Configurations conf;
    conf.setToDefault();
    conf.setGlobally(el::ConfigurationType::Format, "[%datetime | %level] %func(L%line) %msg");
    conf.setGlobally(el::ConfigurationType::Filename, "log_%datetime{%Y%M%d}.log");
    conf.setGlobally(el::ConfigurationType::Enabled, "true");
    conf.setGlobally(el::ConfigurationType::ToFile, "true");
    el::Loggers::reconfigureAllLoggers(conf);
    el::Loggers::reconfigureAllLoggers(el::ConfigurationType::ToStandardOutput, "true"); // 也输出一份到终端

//     el::Configurations conf{ LOG_PATH};
     el::Loggers::reconfigureAllLoggers(conf);

//    LOG(VERBOSE) << "logger test"; //该级别只能用宏VLOG而不能用宏 LOG(VERBOSE)
    LOG(TRACE) << " logger";
//    LOG(DEBUG) << "logger test";
    LOG(INFO) << "logger test";
    LOG(WARNING) << "logger test";
    LOG(ERROR) << "logger test";
    QApplication a(argc, argv);
    HomeWindow w;
    // 设置样式表
//    w.setStyleSheet("QMainWindow {"
//                                "background-color: #f0f0f0;" // 设置窗口背景颜色
//                                "color: #000000;"             // 设置文字颜色
//                                "font-size: 14px;"            // 设置文字大小
//                             "}");

    w.show();

    return a.exec();
}
